2a0967
@@ -398,6 +398,12 @@
public class HierarchicalINIConfiguration extends
      * <pre>
      * 'value' ; comment -&gt; value
      * </pre>
+     * Note that a comment character is only recognized if there is at least one
+     * whitespace character before it. So it can appear in the property value,
+     * e.g.:
+     * <pre>
+     * C:\\Windows;C:\\Windows\\system32
+     * </pre>
      *
      * @param val the value to be parsed
      * @param reader the reader (needed if multiple lines have to be read)
@@ -420,6 +426,7 @@
public class HierarchicalINIConfiguration extends
             int i = quoted ? 1 : 0;
 
             StringBuffer result = new StringBuffer();
+            char lastChar = 0;
             while (i < value.length() && !stop)
             {
                 char c = value.charAt(i);
@@ -452,17 +459,18 @@
public class HierarchicalINIConfiguration extends
                 }
                 else
                 {
-                    if (!isCommentChar(c))
+                    if (isCommentChar(c) && Character.isWhitespace(lastChar))
                     {
-                        result.append(c);
+                        stop = true;
                     }
                     else
                     {
-                        stop = true;
+                        result.append(c);
                     }
                 }
 
                 i++;
+                lastChar = c;
             }
 
             String v = result.toString();
